package com.byq.mm.smartlib.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.byq.mm.abstractx.protocol.Defination;
import com.byq.mm.smartlib.R;

public class RequestActivity extends AbstractSmartActivity {

		Defination defination;
		String from;
	  @Override
	  public void onCreate(Bundle icicle) {
	    super.onCreate(icicle);
	    defination = (Defination)this.getIntent().getExtras().get("defination");
	    from = this.getIntent().getExtras().getString("from");
	    setContentView(R.layout.request);
	   
	    Button agree = (Button)this.findViewById(R.id.agree);

	    Button refuse = (Button)this.findViewById(R.id.refuse);
	  
	    agree.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				application.getAndroidSmartEngine().getCoreEngine().getServerDeviceManager().offer(from);
				finish();
			}
		});
	    refuse.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				application.getAndroidSmartEngine().getCoreEngine().getClientDeviceManager().refuse(from);
				finish();			
			}
		});
	
	  
	  }
}
